package com.readaloud.hibernate.user;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

@Entity
public class Reader extends Users implements Serializable {
	
	//@Id @GeneratedValue
	private int readerId;
	private String ReaderName;

	/*@ManyToMany(mappedBy = "readerList")
	@NotFound(action = NotFoundAction.IGNORE)
	private Collection<Books_old> bookList = new ArrayList<Books_old>();*/
	
	@OneToMany(mappedBy = "reader",cascade=CascadeType.ALL)
	@NotFound(action = NotFoundAction.IGNORE)
	private Collection<Comment> readerCommentList = new ArrayList<Comment>();
	
	public String getReaderName() {
		return ReaderName;
	}

	public void setReaderName(String readerName) {
		ReaderName = readerName;
	}

	public Collection<Comment> getReaderCommentList() {
		return readerCommentList;
	}

	public void setReaderCommentList(Collection<Comment> readerCommentList) {
		this.readerCommentList = readerCommentList;
	}

	public int getReaderId() {
		return readerId;
	}

	public void setReaderId(int readerId) {
		this.readerId = readerId;
	}
	
}
